import {
  SystemZeroCodeSave,
  SystemZeroCodeFindById,
  SystemDataBaseTable,
  SystemDataBaseView,
  SystemDataBaseProc,
} from "@/services/api";
import { request, METHOD } from "@/utils/request";

/**
 * 保存
 */
export async function save(form) {
  return request(SystemZeroCodeSave, METHOD.POST, form);
}

/**
 * 根据Id获取
 */
export function findById(id) {
  return request(SystemZeroCodeFindById + "/" + id, METHOD.GET, {});
}

/**
 * 表
 */
export async function table(param) {
  return request(SystemDataBaseTable, METHOD.POST, param);
}

/**
 * 视图
 */
export async function view(param) {
  return request(SystemDataBaseView, METHOD.POST, param);
}

/**
 * 存储过程
 */
export async function proc(param) {
  return request(SystemDataBaseProc, METHOD.POST, param);
}

export default {
  table,
  view,
  proc,
  save,
  findById,
};
